#include <iostream>
using namespace std;

const int N = 7;
int g[N][N];
int n, m, t, sx, sy, ex, ey;
int ans = 0; //记录方法的数量

int dir[4][2] = {
	{0,1},{1,0},{0,-1},{-1,0}
};

void dfs(int x, int y)
{
	if (x == ex && y == ey) {
		ans++;
		return;
	}
	g[x][y] = 0;//表示当前点遍历过
	for (int i = 0; i < 4; i++) {
		int dx = x + dir[i][0], dy = y + dir[i][1];
		if (g[dx][dy] == 0)  continue;
		dfs(dx, dy);
	}
	g[x][y] = 1;
}

int main()
{
	cin >> n >> m >> t;
	for (int i = 1; i <= n; i++){
		for(int j =1;j<=m;j++) g[i][j] = 1;
	}
	cin >> sx >> sy >> ex >> ey;
	for (int i = 0; i < t; i++) {
		int x, y;
		cin >> x >> y;
		g[x][y] = 0;
	}
	dfs(sx, sy);
	cout << ans << "\n";
	return 0;
}